<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ajax</title>
</head>
<script src="../js/jquery-3.4.1.js"></script>
<script>
    function login() {
        console.log(111);
    }
    /*$(function () {
        $("#outer").click(function () {
            $("#div1").load("../txt/outer.txt",function (responseTxt,statusTxt,xhr) {
                if(statusTxt=="success")
                    console.log("外部内容加载成功!");
                if(statusTxt=="error")
                    console.log("Error: "+xhr.status+": "+xhr.statusText);
            });
        });
        $("#submit").click(function () {
            $.post("../../index.jsp",
                {
                    name:$(":text").val(),
                    password:$(":password").val()
                },
                function(data,status){
                    $("span").empty();
                    $("span").html(data);
                    console.log("数据: \n" + data + "\n状态: " + status);
                });
        });

    })*/
</script>
<body>
    <div id="div1"><h2>使用 jQuery AJAX 修改文本内容</h2></div>
    <button id="outer">获取外部内容</button>
    <form>
        用户名：<input type="text" name="userName">
        密码：<input type="password" name="password">
        <input type="button" id="submit" value="提交" onclick="login();">
    </form>
    <span></span>

</body>
</html>